toList

abstract fun toList(): List<T>

Returns a singleton list containing the option's value if it is defined, or an empty list if the option is empty.

Return

A singleton list returning the option's value if it is defined, or an empty iterator if the option is empty.